language: php

php:
  # 5.3.0 is not supported by Travis
  - 5.3.3
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - hhvm

before_script:
  - composer self-update
  # --prefer-source is required to avoid hitting GitHub API limit:
  # https://github.com/composer/composer/issues/1314
  - composer install --no-interaction --prefer-source --dev

script:
  - phpunit --verbose --coverage-clover build/logs/clover.xml

after_success:
  - bash -c 'if [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi;'
  - bash -c 'if [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi;'
